<?#//v.3.1.0
#///////////////////////////////////////////////////////
#//  COPYRIGHT 2004 Phpauction.org ALL RIGHTS RESERVED//
#///////////////////////////////////////////////////////

require('../includes/config.inc.php');
include "loggedin.inc.php";
include $include_path.'time.inc.php';


unset($ERR);

#//
if($_POST['action'] == "update" && phpa_securepost($_POST)) {
	#// Update database
	$query = "update PHPAUCTIONXL_settings set timecorrection=".intval($_POST['correction']);
	$res = @mysql_query($query);
	if(!$res) {
		print "Error: $query<BR>".mysql_error();
		exit;
} else {
		$ERR = $MSG_347;
		$SETTINGS = $_POST;
	}

	#// Update database
	$query = "update PHPAUCTIONXL_version_2_0 set intl_date_time=".intval($_POST['activated'])." WHERE id=1";
	$res = @mysql_query($query);                                                                    
	if(!$res) {
		print "Error: $query<BR>".mysql_error();
		exit;
} else {
		$ERR = $MSG_347;
		$SETTINGS = $_POST;
	}	
	
	
	
	
	
	
	
	
	
	
	
}
#//
$query = "SELECT * FROM PHPAUCTIONXL_settings";
$res = @mysql_query($query);
if(!$res) {
	print "Error: $query<BR>".mysql_error();
	exit;
} elseif(mysql_num_rows($res) > 0) {
	$SETTINGS = mysql_fetch_array($res);
}



   $query_settings3 = "select * from PHPAUCTIONXL_version_2_0 where id='1'";
                             $query_settings4 =  mysql_query ($query_settings3);
                                $activated = mysql_result($query_settings4,0,"intl_date_time");




?>
<HTML>
<HEAD>
<link rel='stylesheet' type='text/css' href='style.css' />
<link href="css/main.css" rel="stylesheet" type="text/css">
</HEAD>
<bodyleftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<table width="100%" border="0" cellpadding="0" cellspacing="0">
  <tr> 
    <td><table width="100%" border="0" cellspacing="0" cellpadding="0" class="titulo">
        <tr> 
          <td class="icono"><img src="images/pref_icon2.gif" width="28" height="28"></td>
          <td class="breadcrumbs"><p><span><?=$MSG_25_0008?></span>&nbsp;&gt;&gt;&nbsp;<?=$MSG_344?></p></td>
        </tr>
      </table></td>
  </tr>
  <tr>
    <td align="center" valign="middle">&nbsp;</td>
  </tr>
    <tr> 
    <td align="center" valign="middle">
<TABLE BORDER=0 WIDTH=100% CELLPADDING=0 CELLSPACING=0 BGCOLOR="#FFFFFF">
<TR>
<TD align="center">
<BR>
<FORM NAME=conf ACTION=<?=basename($_SERVER['PHP_SELF'])?> METHOD=POST>
	<TABLE WIDTH="95%" BORDER="0" CELLSPACING="0" CELLPADDING="0" class="base" style="border:1px solid #ccc;">
		<TR>
			<TD ALIGN=CENTER class=title>
			<p>	<? print $MSG_344; ?></p>
			</TD>
		</TR>
		<TR>
			<TD>
				<TABLE WIDTH=100% ALIGN="CENTER" CELLPADDING=0 cellspacing="0" BGCOLOR="#FFFFFF">
				<?
				if(isset($ERR)) {
				?>
					<TR>
						<TD COLSPAN="2" class="error">
							<p><?=$ERR?></p>							 </TD>
					</TR>
				<?
				}
				?>

					<TR VALIGN="TOP">
						<TD WIDTH=169 HEIGHT="22">
							<p class="blue"><? print $MSG_346; ?>			</p>			</TD>
						<TD WIDTH="368" HEIGHT="22"><A HREF="./increments.php" CLASS="links">
							</A>
							<SELECT NAME="correction">
								<?
								foreach($TIMECORRECTION as $k=>$v) {
									print "<OPTION VALUE='$k'";
									if($SETTINGS['timecorrection'] == intval($k)) print " SELECTED";
									print ">$v</OPTION>\n";
								}
				?>
							</SELECT>	&nbsp;&nbsp;&nbsp;&nbsp;

   <? print $MSG_345; ?>
										</TD>
					</TR>
					
					        <TR>
        <TD WIDTH="125" class="gris">
					<p class="blue"><? print $MSG_AJAX_ADMIN_INTL_TIME_DATE_ON_OFF; ?></p>
					</TD>
					
					
				<TD WIDTH="405"  class="gris">
				
					
					 
<input type="radio" name="activated" value="1" <? if ( $activated == 1 ) echo checked ?> /> <? print $MSG_AJAX_ADMIN_SELL_ON; ?> &nbsp;&nbsp; <input type="radio" name="activated" value="0" <? if ( $activated == 0 ) echo checked ?> /> <? print $MSG_AJAX_ADMIN_SELL_OFF; ?>  &nbsp;&nbsp;&nbsp;&nbsp;

   <? print  $MSG_AJAX_ADMIN_INTL_TIME_DATE_ON_OFF_NOTE; ?>
						
</TD>
			</TR>
					
					
					
					
					
					
					
					<TR>
						<TD WIDTH=169>
							<INPUT TYPE="hidden" NAME="action" VALUE="update" /> <INPUT TYPE="hidden" NAME="security" VALUE="<?php echo $_SESSION['security'];?>" />						</TD>
						<TD WIDTH="368">
							<INPUT TYPE="submit" NAME="act" VALUE="<? print $MSG_530; ?>" class="action">						</TD>
					</TR>
					<TR>
						<TD WIDTH=169></TD>
						<TD WIDTH="368"> </TD>
					</TR>
				</TABLE>
			</TD>
		</TR>
	</TABLE>
	</FORM>
</TD>
</TR>
</TABLE>
</TD>
</TR>
</TABLE>
</BODY>
</HTML>
